package com.my.baidu;


import net.sf.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @Auther: szh
 * @Date:2021-06-22 15:00
 */

public class Main {

    private static String token;

    public static void main(String[] args) {
        token=AuthService.getAuth();
//        String imgURL="C:\\Users\\Admin\\Desktop\\u=1631582372,4013670020&fm=11&gp=0.jpg";
        String imgURL="D:\\svnWorkspace\\11.jpg";
        String s = WebImage.webImage(imgURL, token);
        JSONObject json = JSONObject.fromObject(s);
        String words_result = json.getString("words_result");
        words_result=words_result.substring(2,words_result.length()-2);
        System.out.println(words_result);
        String[] split = words_result.split("},\\{");
        for (String s1 : split) {
            System.out.println(s1.substring(9,s1.length()-1));
        }
    }
}
